home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / comm / cnet / cnet_wof.lha / wof.lha / support.lha / AMaint < prev    next >
Text File  |  1997-04-17  |  3KB  |  87 lines

  1. /**************************************************************************\
  2.         $VER: WOF AMaint, v6.51 (17-Apr-97) by Dotoran of Frontiers!
  3. \**************************************************************************/
  4. options results;signal on SYNTAX;signal on ERROR;signal on IOERR
  5. a=sourceline(2);parse var a . ", "ver" ("vdate")" .
  6. tr=transmit;se=sendstring;gc=getchar;gu=getuser;gs=getscratch;mg=maygetchar
  7. a="rexxsupport.library";if ~show("l",a) then if ~addlib(a,0,-30) then exit
  8. parse source . . fp .;df=left(fp,max(lastpos('/',fp),lastpos(':',fp)))
  9.  
  10. tr "f1Wheel of Fortune AMaint, "word(sourceline(2),4)
  11. se "n1Reading Suspension Slots..."
  12. dfile=df ; tfile=df"Texts/"
  13. call open(f1,dfile"!Settings","r")
  14.   do 4 ; a=readln(f1) ; end
  15. call close(f1) ; save=0
  16. do i=1 to 6
  17.   parse var a Sid.i"|"Sok.i"|"a
  18. end i ; d1=date("i")
  19. tr "Done.n2Examining Slots:n1"
  20.  
  21. do i=1 to 6 ; se "  Slot # "i": "
  22.   if datatype(Sid.i,"n")=1 then do ; loadscratch Sid.i ; st=0
  23.     savescratch (-Sid.i) ; getscratch 1 ; han=result ; end
  24.   if Sid.i="" then do ; tr "Empty!" ; iterate ; end
  25.   if Sok.i="Never" then do
  26.     tr "Prohibit ID # "Sid.i" ("han") from playing!" ; iterate ; end
  27.   d2=date("i","19"Sok.i,"s")
  28.   if d2-d1>0 then tr "ID # "Sid.i" ("han") Suspended another "d2-d1" days!"
  29.   if d2-d1<=0 then do ; Sid.i="" ; Sok.i="" ; save=1
  30.     tr "ID # "Sid.i" ("han") Suspension over; clearing slot."
  31.   end
  32. end i
  33.  
  34. if save=1 then do ; se "n1Saving changed Suspension Slots..."
  35.   a="" ; do i=1 to 6 ; a=a||Sid.i"|"Sok.i"|" ; end i ; a=a"x"
  36.   call open(f1,dfile"!Settings","r")
  37.     do i=1 to 13 ; l.i=readln(f1) ; end i ; l.i=a
  38.   call close(f1)
  39.   call open(f1,dfile"!Settings","w")
  40.     do i=1 to 13 ; call writeln(f1,l.i) ; end i
  41.   call close(f1) ; tr "Done!"
  42. end
  43.  
  44. /* Verify Players */
  45.  
  46. call open(f1,tfile'Players','r')
  47.   bad=0
  48.   do i=1 until eof(f1)
  49.     p.i=readln(f1)
  50.   end i
  51.   total=i-1
  52. call close(f1)
  53.  
  54. tr "@4n1Verifying Players...n1"
  55. do i=1 to total
  56.   parse var p.i han.i'|'j
  57.   se '  'han.i
  58.   setobject "1" ; putuser 1109799 /* Activate ! quick mode */
  59.   findaccount han.i ; id.i=result
  60.   if id.i<1 then do 
  61.     tr ' not found.' ; bad=bad+1 ; p.i='' ; end
  62.   else tr ' found.'
  63. end i
  64.  
  65. setobject "0" ; putuser 1109799 /* Deactivate ! quick mode */
  66.  
  67. if bad>0 then do
  68.   call open(f1,tfile'Players','w')
  69.     do i=1 to total
  70.       if p.i~='' then call writeln(f1,p.i)
  71.     end i
  72.   call close(f1)
  73. end
  74.  
  75. tr "n1Saved "total-bad" of "total" players."
  76.  
  77. tr "n1WOF AutoMaintenance Complete!n1"
  78.  
  79. exit
  80. SYNTAX:;ERROR:;IOERR:;e1="n1 Error: "rc" ("errortext(rc)")"
  81.   e2="  Line: "left(sigl,4)"File:";c="`"fp", "ver"'";e2=e2" "c;tr e1;tr e2
  82.   logentry e1;logentry e2;e=strip(translate(sourceline(sigl),"\{",""))
  83.   do while e~="";e3="Source: "left(e,37);tr e3;logentry e3;e=substr(e,38);end
  84.   bufferflush
  85. /**************************************************************************\
  86. \****************************************** Frontiers BBS (716)/823-9892 **/
  87.